package com.example.rentalcar.controller;


import com.example.rentalcar.entity.Worker;
import com.example.rentalcar.service.IWorkerService;
import com.example.rentalcar.service.impl.WorkerServiceImpl;
import com.example.rentalcar.util.R;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;


@RestController
@RequestMapping("/api/worker")
public class WorkerController
{
    @Autowired
    IWorkerService workerService;



    @GetMapping("/{id}")
    public R findById(@PathVariable Long workerId){

        Worker worker = workerService.findById(workerId);
        System.out.println(worker);
        return R.ok();

    }

}
